package com.lz.gmall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.gmall.product.entity.BaseCategory3;
import com.lz.gmall.product.service.BaseCategory3Service;
import com.lz.gmall.product.mapper.BaseCategory3Mapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class BaseCategory3ServiceImpl extends ServiceImpl<BaseCategory3Mapper, BaseCategory3>
    implements BaseCategory3Service{

    /**
     * 根据二级产品获取三级产品
     * @param cate2Id 二级产品id
     * @return三级产品集合
     */
    @Override
    public List<BaseCategory3> findAllByCate2Id(Long cate2Id) {
        LambdaQueryWrapper<BaseCategory3> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BaseCategory3::getCategory2Id,cate2Id);
        List<BaseCategory3> list = this.list(wrapper);
        return list;
    }
}




